package com.community.controller;

import com.community.pojo.Product;
import com.community.pojo.ProductType;
import com.community.service.IProductService;
import com.community.service.IProductTypeService;
import com.community.utils.PageUtils;
import com.community.vo.ProductVo;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author TangHaoSong Fly ChenJie HeYuHang
 * @since 2024-05-15
 */
@CrossOrigin
@Controller
@RequestMapping("/community/productType")
public class ProductTypeController {

    @Autowired
    private IProductTypeService productTypeService;



    @RequestMapping("/list")
    @ResponseBody
    public List<ProductType> list(){

        return this.productTypeService.list();
    }
    /**
     * 查询所有分类名字
     * @return
     */
    @RequestMapping("/list2")
    @ResponseBody
    public List<ProductType> list2(){
        return this.productTypeService.productType();

    }
}
